package StudyCode.summary.zipfile;

import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class DetermineNumberOfBytesWrittenToDataOutputStream {
	public static void main(String[] args) {
		String strFilePath = "E:/Copy/2.txt";

		try {
			FileOutputStream fos = new FileOutputStream(strFilePath);

			DataOutputStream dos = new DataOutputStream(fos);

			String str = "www.tah1986.com";
			dos.writeBytes(str);

			int bytesWritten = dos.size();
			System.out.println("总共 " + bytesWritten + " 个字节被写入到流.");

			dos.close();

		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
